{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">

                        <div class="layui-input-inline layui-form">
                            <select name="complain_status" lay-search="">
                                <option  value="">不限状态</option>
                                <option  value="1">待处理</option>
                                <option  value="2">已处理</option>
                                <option  value="3">已忽略</option>
                            </select>
                        </div>

                        <div class="layui-col-md6 layui-input-inline">
                            <input type="text" id="user_phone" class="layui-input search" name="user_phone" value="" placeholder="手机号"/>
                        </div>

                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--搜索框结束-->
                <!--操作框开始-->
                <!--<div class="col-sm-12">-->
                    <!--<div class="input-group" >-->
                        <!--<button class="btn btn-primary" type="button" onclick="wk.href('{:url('add')}');">-->
                            <!--<i class="fa fa-plus"></i> 添加轮播图-->
                        <!--</button>-->
                    <!--</div>-->
                <!--</div>-->
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <!--图片模板-->
                    <script type="text/html" id="imgTpl">
                        <ul onclick="view(this)" id="view_{{d.complain_id}}" class="class_view">
                            <li><img data-original="{{d.picture}}" src="{{d.picture}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  /></li>
                            {{# if(d.complain_img.length >= 1){ }}
                            {{# for(var i=0;i<d.complain_img.length;i++){  }}
                            <li><img class="img-circle table-img" src="{{d.complain_img[i]}}" ></li>
                            {{# } }}
                            {{# } }}
                        </ul>
                    </script>
                    <!--商户logo-->
                    <script type="text/html" id="imgTpl1">
                        <img src="{{d.s_thumb}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
                    </script>

                    <!--类型模板-->
                    <script type="text/html" id="typeTpl">
                        {{# if(d.complain_status == 1){ }}
                        待处理
                        {{# } }}
                        {{# if(d.complain_status == 2){ }}
                        已处理
                        {{# } }}
                        {{# if(d.complain_status == 3){ }}
                        已忽略
                        {{# } }}
                    </script>

                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        <a href="javascript:;" onclick="wk.href('{:url('complainDetail')}?complain_id={{d.complain_id}}')" class="btn btn-primary btn-xs m-r-xs" title="查看详情"><i class="fa fa-search"></i></a>
                        {{# if(d.complain_status == 1){ }}
                        <a href="javascript:;" onclick="wk.confirm('{{d.complain_id}}','{:url('complainPast')}','确定要忽略这条信息吗？')" class="btn btn-danger btn-xs m-r-xs" title="忽略"><i class="fa fa-times-circle"></i></a>
                        <a href="javascript:;" onclick="wk.confirm('{{d.complain_id}}','{:url('complainDone')}','确定要处理这条信息吗？')" class="btn btn-primary btn-xs m-r-xs" title="处理"><i class="fa fa-pencil"></i></a>
                        {{# } }}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Complain/index")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                ,{field:'complain_time', width: '', title: '投诉时间'}
                , {field: 'complain_status', width: '', title: '投诉状态', align: 'center',templet:'#typeTpl'}
                , {field: 'user_phone', width: '', title: '投诉账号', align: 'center'}
                , {field: 'task_number', width: '', title: '任务编号', align: 'center'}
                , {field: 's_name', width: '', title: '商户名称', align: 'center'}
                , {field: 's_thumb', width: '', title: '商户LOGO', align: 'center',templet:'#imgTpl1'}
                , {field: 's_num', width: '', title: '商户编号', align: 'center'}
                , {field: 'complain_content', width: '', title: '投诉内容', align: 'center'}
                , {field: 'complain_img', width: '', title: '投诉图片', align: 'center',templet:'#imgTpl'}
                , {fixed: 'right', width: 130, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.class_view').viewer({
                });
            }
        });
    });
</script>
</body>
</html>